#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
void out(double t) { cout << fixed << setprecision(10) << t; }
void solve() {
  int a, v, l, d, w;
  cin >> a >> v >> l >> d >> w;
  if (v <= w || 2 * a * d <= w * w) {
    // with deceleration
    if (2 * a * l <= v * v) {
      double t = sqrt(2 * a * l) / a;
      out(t);
    } else {
      double s1 = v * v / 2.0 / a;
      double t = 1.0 * v / a;
      double s2 = l - s1;
      t += s2 / v;
      out(t);
    }
  } else {
    double t = 0;
    double v2 = sqrt(a * d + w * w * 0.5);
    if (v2 > v) v2 = v;
    // acceleration
    double t1 = 1.0 * v2 / a;
    double s1 = v2 * v2 / 2.0 / a;
    // deceleration
    double t2 = 1.0 * (v2 - w) / a;
    double s2 = (v2 * v2 - w * w) / 2.0 / a;
    double s3 = d - s1 - s2;
    double t3 = s3 / v2;
    t = t1 + t2 + t3;
    if (v * v - w * w > 2.0 * a * (l - d)) {
      double v3 = sqrt(w * w + 2.0 * a * (l - d));
      double t4 = (v3 - w) / a;
      t += t4;
    } else {
      double s4 = (v * v - w * w) / 2.0 / a;
      double t4 = (v - w) * 1.0 / a;
      double s5 = l - d - s4;
      double t5 = s5 / v;
      t += t4 + t5;
    }
    out(t);
  }
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}